<!--学员条形码打印-->
<template>
  <div class="wrapper-container">
    <div
      class="search-container"
      style="justify-content: space-between !important;margin-top: 0px !important;"
    >
      <div class="search-container filter-button1" style="margin-top:0">
        <el-radio-group v-model="radio4" size="mini" @change="handleRadio">
          <el-radio-button
            style="padding-right: 10px;"
            label="按专业班次打印条形码"
          >按专业班次打印条形码
          </el-radio-button
          >
          <el-radio-button style="padding-right: 10px;" label="按学员打印条形码"
          >按学员打印条形码
          </el-radio-button
          >
          <el-radio-button label="按考试课程打印条形码"
          >按考试课程打印条形码
          </el-radio-button
          >
        </el-radio-group>
      </div>
      <div v-if="radio4 == '按考试课程打印条形码'" class="filter-button">
<!--        <InputItem-->
<!--          :name="'每个学员打印'"-->
<!--          :value="address"-->
<!--          :endText="'条'"-->
<!--          @input="-->
<!--            (e) => {-->
<!--              address = e;-->
<!--            }-->
<!--          "-->
<!--        ></InputItem>-->
        <span style="margin-top: 3px; margin-right: 15px; color: #004ca7;">每个学员打印</span>
        <el-input-number v-model="address" controls-position="right" size="mini" :min="1" :max="99" style="margin-top: -2px;" />
        <span style="margin-top: 3px; margin-left: 15px; margin-right: 20px; color: #004ca7;">条</span>
        <ButtonItem
          :name="'打印条形码'"
          :link="''"
          :buttonColor="'purple'"
          @click="printBar"
        ></ButtonItem>
      </div>
    </div>

    <div class="search-container" style="margin-top:15px">
      <div class="search-container-item" v-if="radio4 == '按考试课程打印条形码'">
        <span style="color:#004ca7">学期： </span>
        <el-select
          v-model="term"
          size="mini"
          clearable
          style="width: 88px;margin:0 10px 0 0"
          placeholder="请选择"
        >
        <!-- @clear="Tjkcqueryallscore" -->
          <el-option
            v-for="item in xqList"
            :key="item.xqmc"
            :label="item.xqmc"
            :value="item.xqmc"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 == '按考试课程打印条形码'">
        <span style="color:#004ca7">批次： </span>
        <el-select
          v-model="pc"
          size="mini"
          clearable
          style="width: 88px;margin:0 10px 0 0"
          placeholder="请选择"
        >
        <!-- @clear="Tjkcqueryallscore" -->
          <el-option
            v-for="(item,index) in pcList"
            :key="index"
            :label="item"
            :value="item"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 == '按考试课程打印条形码'">
        <span style="color:#004ca7">课程负责单位：</span>
        <el-select
          v-model="xb"
          style="width: 110px;margin:0 10px 0 0"
          size="mini"
          placeholder="请选择"
          @change="handleXb"
          clearable
        >
          <el-option
            v-for="(item,index) in xbList"
            :key="index"
            :label="item.deptName"
            :value="item.deptName"
          >
          </el-option>
        </el-select>
        <el-select
          v-model="classroom"
          style="width: 95px;margin:0 10px 0 0"
          size="mini"
          placeholder="请选择"
          @change="handleClass"
          clearable
        >
          <el-option
            v-for="(item,index) in gClassList"
            :key="index"
            :label="item.deptName ? item.deptName : item.value"
            :value="item.deptName ? item.deptName : item.value"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 != '按学员打印条形码'">
        <span style="color:#004ca7">年级: </span>
        <el-select
          v-model="grade"
          size="mini"
          clearable
          style="width: 90px;margin:0 10px 0 10px"
          placeholder="请选择"
        >
          <el-option
            v-for="(item,index) in gradeList"
            :key="index"
            :label="item.xqszxn"
            :value="item.xqszxn"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 != '按学员打印条形码'">
        <span style="color:#004ca7">专业班次: </span>
        <el-select
          v-model="major"
          size="mini"
          clearable
          style="width: 125px;margin:0 10px 0 10px"
          placeholder="请选择"
        >
          <el-option
            v-for="item in classNameList"
            :key="item.className"
            :label="item.className"
            :value="item.className"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 != '按学员打印条形码'">
        <span style="color:#004ca7">培养层次: </span>
        <el-select
          v-model="pycc"
          size="mini"
          clearable
          style="width: 93px;margin:0 0 0 10px"
          placeholder="请选择"
        >
          <el-option
            v-for="item in pyccList"
            :key="item.dictKey"
            :label="item.dictValue"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 == '按考试课程打印条形码'" style="margin:0 0 0 10px">
        <span style="color:#004ca7">修习类型： </span>
        <el-select
          v-model="type"
          size="mini"
          clearable
          style="width: 90px;"
          placeholder="请选择"
        >
          <el-option
            v-for="item in typeList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </div>
      <div class="search-container-item" v-if="radio4 == '按考试课程打印条形码'" style="margin:0 0 0 10px">
        <span style="color:#004ca7">课程名称: </span>
        <el-input
          v-model="courseName"
          size="mini"
          clearable
          style="width: 120px"
          placeholder="请输入"
        ></el-input>
      </div>
      <div class="search-container-item" v-if="radio4 == '按学员打印条形码'">
        <span style="color:#004ca7">姓名: </span>
        <el-input
          v-model="studentName"
          size="mini"
          clearable
          style="width: 120px;margin:0 10px 0 10px"
          placeholder="请输入姓名"
        ></el-input>
      </div>
      <div class="search-container-item" v-if="radio4 == '按学员打印条形码'">
        <span style="color:#004ca7">学号: </span>
        <el-input
          v-model="studentNum"
          size="mini"
          clearable
          style="width: 120px;margin:0 0 0 10px"
          placeholder="请输入学号"
        ></el-input>
      </div>
      <div class="search-button" style="margin: 2px 0 0 15px;" @click="Inquire(radio4)">
        <img src="../../../assets/assessment/icon-search.png" alt=""/>
        <span>查询</span>
      </div>
      <span v-if="radio4 === '按学员打印条形码'" style="color:rgb(0, 76, 167);margin-left:10px;line-height:28px">每个学员打印</span>
<!--      <el-input-->
<!--        v-if="radio4 === '按学员打印条形码'"-->
<!--        v-model="address"-->
<!--        size="mini"-->
<!--        clearable-->
<!--        style="width: 120px;margin:0 10px"-->
<!--      ></el-input>-->
      <el-input-number v-if="radio4 === '按学员打印条形码'" v-model="address" controls-position="right" size="mini" :min="1" :max="99" style="width: 120px;margin:0 10px" />
      <span v-if="radio4 === '按学员打印条形码'" style="color:rgb(0, 76, 167);margin-left:10px;line-height:28px">条</span>
      <!-- <InputItem
        v-if="radio4 == '按学员打印条形码'"
        :name="'每个学员打印'"
        :value="address"
        :endText="'条'"
        @input="
          (e) => {
            address = e;
          }
        "
      ></InputItem> -->
      <!-- <ButtonItem
        style="margin-top:2px;font-size:14px"
        v-if="radio4 != '按考试课程打印条形码'"
        :name="'打印条形码'"
        :link="''"
        :buttonColor="'purple'"
        @click="printBarcode()"
      ></ButtonItem> -->
      <div v-if="radio4 != '按考试课程打印条形码'" class="search-button" style="width:100px;margin: 2px 15px 0;color: #5e36eb;
          border: 1px solid #5e36eb;
          background: #ebe4fe;">
        <span @click="printBarcode()" style="color:#5e36eb">打印条形码</span>
      </div>
    </div>
    <!-- 按考试课程打印条形码 -->
    <div v-if="radio4 == '按考试课程打印条形码'" class="table-container">
      <el-table
        :data="tableData3"
        style="width: 100%"
        @selection-change="handleSelection"
        class="xpaas-table-class"
        row-class-name="xpaas-row-class"
        cell-class-name="xpaas-cell-class"
        header-row-class-name="xpaas-header-row-class"
        header-cell-class-name="xpaas-header-cell-class"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="department" label="系" align="center">
        </el-table-column>
        <el-table-column prop="designcontent" label="教研室" align="center">
        </el-table-column>
        <el-table-column prop="grade" label="年级" align="center">
        </el-table-column>
        <el-table-column prop="specialtyName" label="专业班次" align="center">
        </el-table-column>
        <el-table-column
          prop="traininglevel"
          label="培养层次"
          align="center"
        >
        </el-table-column>
       <el-table-column prop="coursetype" label="修习类型" align="center">
        </el-table-column>
        <el-table-column prop="coursenumber" label="课程编码" align="center">
        </el-table-column>
        <el-table-column prop="coursename" label="课程名称" align="center">
        </el-table-column>
      </el-table>
      <div v-if="radio4 === '按考试课程打印条形码'" style="float: right; margin-top: 15px; padding-bottom: 15px;">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          style="padding: 0;">
        </el-pagination>
      </div>
    </div>
    <!-- 按学员打印条形码 -->
    <div
      v-if="radio4 == '按学员打印条形码'"
      class="table-container2 table-container"
    >
      <div style="display: flex;width: 100%">
        <table style="width:100%">
          <tr>
            <td style="width:50%" valign="top">
              <el-table
                :data="tableData1"
                style="width: 95%;margin-right: 10px;"
                class="xpaas-table-class"
                row-class-name="xpaas-row-class"
                cell-class-name="xpaas-cell-class"
                header-row-class-name="xpaas-header-row-class"
                header-cell-class-name="xpaas-header-cell-class"
                @selection-change="handleSelectionChange"
              >
                <el-table-column type="selection" width="55" align="center"></el-table-column>
                <el-table-column prop="specialtyClassInfo.specialtyName" label="专业名称" align="center">
                </el-table-column>
                <el-table-column prop="specialtyClassName" label="专业班次" align="center">
                </el-table-column>
                <el-table-column prop="studentCode" label="学号" align="center">
                </el-table-column>
                <el-table-column prop="studentName" label="姓名" align="center">
                </el-table-column>
              </el-table>
            </td>
            <td style="width:50%" valign="top">
              <el-table
                :data="tableData2"
                style="width: 95%;margin-left: 10px;"
                class="xpaas-table-class"
                row-class-name="xpaas-row-class"
                cell-class-name="xpaas-cell-class"
                header-row-class-name="xpaas-header-row-class"
                header-cell-class-name="xpaas-header-cell-class"
              >
                <el-table-column type="selection" width="55" align="center"></el-table-column>
                <el-table-column prop="specialtyClassInfo.specialtyName" label="专业名称" align="center">
                </el-table-column>
                <el-table-column prop="specialtyClassName" label="专业班次" align="center">
                </el-table-column>
                <el-table-column prop="studentCode" label="学号" align="center">
                </el-table-column>
                <el-table-column prop="studentName" label="姓名" align="center">
                </el-table-column>
                <el-table-column prop="delete" width="120" label="删除" align="center">
                  <template slot-scope="scope">
                    <!-- <ButtonItem
                      @click="deleTran(scope.row)"
                      :name="'删除'"
                      :link="''"
                      :icon="'el-icon-delete'"
                      :buttonColor="'red'"
                    ></ButtonItem> -->
                    <div class="search-button" style="width:70px;margin: 2px 15px 0;color: #ff3819;
                        border: 1px solid #ff3819;
                        background: #ffefef;">
                      <span @click="deleTran(scope.row)" style="color:#ff3819">删 除</span>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <div v-if="radio4 == '按学员打印条形码'" class="search-container">
      <!-- <ButtonItem
        style="    margin-left: 20%;"
        :name="'添加'"
        :link="''"
        :buttonColor="'yellow'"
        @click="sureTran"
      ></ButtonItem> -->
      <div v-if="radio4 == '按学员打印条形码'" class="search-button" style="color: #f3b815;
          border: 1px solid #f3b815;
          background: #fff6ef;margin-left: 22%;font-size:16px">
        <span @click="sureTran" style="color:#f3b815">添 加</span>
      </div>
    </div>

    <!-- 按专业班次打印条形码 -->
    <div
      v-if="radio4 == '按专业班次打印条形码'"
      class=" table-container5 table-container "
    >
      <el-table
        ref="printTable"
          style="width: 100%"
          :data="tableData"
          class="xpaas-table-class"
          row-class-name="xpaas-row-class"
          cell-class-name="xpaas-cell-class"
          header-row-class-name="xpaas-header-row-class"
          header-cell-class-name="xpaas-header-cell-class"
          @selection-change="handleSelectionChange0"
        >
        <el-table-column type="selection" width="100" align="center"></el-table-column>
        <el-table-column
          prop="className"
          label="专业班次"
          align="center"
        >
        </el-table-column>
      </el-table>
      <!-- <el-table
        border
        style="width: 200px;"
        :data="tableData3[0]"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
        @selection-change="handleSelectionChange0"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column
          prop="specialtyName"
          width="372"
          label="专业班次"
          align="center"
        >
        </el-table-column>
      </el-table>
      <el-table
        border
        style="width: 200px;"
        :data="tableData3[1]"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
        @selection-change="handleSelectionChange1"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column
          prop="specialtyName"
          width="372"
          label="专业班次"
          align="center"
        >
        </el-table-column>
      </el-table>
      <el-table
        border
        style="width: 200px;"
        :data="tableData3[2]"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
        @selection-change="handleSelectionChange2"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column
          prop="specialtyName"
          width="372"
          label="专业班次"
          align="center"
        >
        </el-table-column>
      </el-table>
      <el-table
        border
        style="width: 200px;"
        :data="tableData3[3]"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
        @selection-change="handleSelectionChange3"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column
          prop="specialtyName"
          width="372"
          label="专业班次"
          align="center"
        >
        </el-table-column>
      </el-table> -->
    </div>
    <div v-if="radio4 === '按专业班次打印条形码'" style="float: right; margin-top: 15px; padding-bottom: 15px;">
      <el-pagination
        @size-change="handleSizeChange1"
        @current-change="handleCurrentChange1"
        :page-size="10"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total1"
        style="padding: 0;">
      </el-pagination>
    </div>
    <!-- <div v-if="radio4 == '按专业班次打印条形码'" class="search-container">
      <ButtonItem
        :name="'导出Excel'"
        :link="''"
        :icon="'el-icon-download'"
        :buttonColor="'yellow'"
        @click=""
      ></ButtonItem>
    </div> -->
<!--    <div class="export-button" style="width: 130px;-->
<!--        background: #fff6ef;-->
<!--        border: 1px solid #f3b815;-->
<!--        height: 28px;-->
<!--        line-height: 28px;-->
<!--        border-radius: 6px;-->
<!--        cursor: pointer;-->
<!--        display: flex;-->
<!--        flex-direction: row;-->
<!--        align-items: center;-->
<!--        justify-content: center;-->
<!--        box-sizing: border-box;margin-top:15px">-->
<!--        <img src="../../../assets/assessment/icon-export.png" style="width: 16px; height: 16px; margin-right: 5px;" alt=""/>-->
<!--        <download-excel-->
<!--          class="export-btn"-->
<!--          type="xls"-->
<!--          name="课程类型维护.xls"-->
<!--          style="color: #f3b815;cursor: pointer"-->
<!--        >-->
<!--          &ensp;导出Excel-->
<!--        </download-excel>-->
<!--        &lt;!&ndash; :data="tableData"-->
<!--        :fields="jsonFields" &ndash;&gt;-->
<!--      </div>-->
    <div style="height: 0; overflow: auto;">
      <div id="printDiv" style="margin: 0; padding: 0;">
        <div v-for="(item, index) in printList" :key="index" style="width: 558px; height: 60px; display: flex; page-break-after: always; padding: 3px 0 0 0;">
          <div style="width: 256px; display: flex; flex-wrap: wrap; margin: 0; padding: 0; font-size: 16px;">
            <div style="display: inline-block; width: 128px; height: 30px; line-height: 16px; text-align: left; margin: 0; padding: 0;">{{ item.studentName }}</div>
            <div style="display: inline-block; width: 128px; height: 30px; line-height: 16px; text-align: right; margin: 0; padding: 0;">{{ item.studentCode }}</div>
            <div style="display: block; width: 256px; height: 31px; line-height: 16px; margin: 0; padding: 0;">{{ item.specialtyClassName }}</div>
          </div>
<div style="display: inline-block; width: 46px; height: 40px;"></div>
          <div style="display: inline-block; width: 256px; height: 60px; margin: 0; padding: 2px 0 0 0; text-align: center;">
            <barcode :value="item.studentCode" :options="barcodeOption" style="width: 90%; height: 50px;"/>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import SelectItem from "../../../components/SelectItem.vue";
import InputItem from "../../../components/InputItem.vue";
import ButtonItem from "../../../components/ButtonItem.vue";
import {getDelFile} from "@/api/propositionReview/approval";
import {getSelectCondition, selectByTeam, studentList,getmajor,getstudent,getcourse, queryCourseList } from "@/api/examination/printBarCode2";
import {reqGetXqList, reqCheckLevelList, reqNjList, reqCheckYearList,reqZybcList} from '@/api/admin1/check';
import {getxb,getClass,queryXBclassroom} from '@/api/course/courses.js'
import {selectPc} from "../../../api/courseExame/coursePlan";
import barcode from '@xkeshi/vue-barcode'
import print from '../../../../public/cdn/print/print.min'
export default {
  components: {
    SelectItem,
    InputItem,
    ButtonItem,
    barcode
  },
  data() {
    return {
      barcodeOption: {
        displayValue: false,
        background: '#ffffff',
        height: '48',
        margin: 2,
        lineColor: '#000000'
      },
      printList: [],
      pageNo:1,
      pageSize:10,
      pageNo1:1,
      pageSize1:10,
      total: 0,
      total1: 0,
      radio4: "按专业班次打印条形码",
      address: "",
      term: "",
      xqList: [],
      pc: "",
      pcList: [],
      xb: "",
      xbList: [],
      classroom:"",
      gClassList:[],
      grade: "",
      gradeList: [],
      className: "",
      major:'',
      classNameList: [],
      pycc: "",
      pyccList: [],
      type: "",
      typeList: [
        {
          value: "选修",
          label: "选修",
        },
        {
          value: "必修",
          label: "必修",
        },
      ],
      courseName: "",
      studentNum: "",
      studentName: "",
      tableData: [],
      tableData1: [],
      tableData2: [],
      tableData3: [],
      multipleSelection: [],
      multipleSelection6: [],
      multipleSelection1: [],
      multipleSelection2: [],
      multipleSelection3: [],
      multipleSelection0: [],
    };
  },
  mounted() {
    selectPc().then(res=>{
      this.pcList = res.data.data;
    })
    reqGetXqList().then((res) => {
      this.xqList = res.data.data
    })
    reqCheckYearList().then((res) => {
      this.gradeList = res.data.data
    })
    reqZybcList().then((res) => {
      this.classNameList = res.data.data
    })
    reqCheckLevelList().then((res) => {
      this.pyccList = res.data.data[0].children
    })
    this.xbAll();
    this.classAll();
    this.Inquire();
  },
  methods: {
    handleCurrentChange(val) {
      this.pageNo = val;
      this.Inquire();
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.Inquire();
    },
    handleCurrentChange1(val) {
      this.pageNo1 = val;
      this.Inquire();
    },
    handleSizeChange1(val) {
      this.pageSize1 = val;
      this.Inquire();
    },
    handleRadio(val){
      this.address = undefined
      if (val === '按专业班次打印条形码') {
        this.getmajor();
      } else if (val === '按学员打印条形码') {
        this.getStudentList();
      } else if(val === '按考试课程打印条形码'){
        this.getcourse();
      }
    },
    //系部数据
    async xbAll(){
      const xb = await getxb();
      xb.data.code == 200 ? this.xbList = xb.data.data : [];
    },
    //教研室数据
    async classAll(){
      const gClass = await getClass();
      gClass.data.code == 200 ? this.gClassList = gClass.data.data : [];
    },
    // 教研室下拉框的改变
    handleClass(val){
      if(!val){
        this.xb ? this.handleXb(this.xb)  : this.classAll();
      }
    },
    // 根据系部选中获取教研室
    async handleXb(val){
      if(val){
        const xbClass = await queryXBclassroom(val);
        xbClass.data.code == 200 ? this.gClassList = xbClass.data.data : [];
        this.classroom = ''
      } else {
        this.xbAll();
        this.classAll();
      }
    },
    Inquire(type) {
      this.pageNo = 1;
      if (this.radio4 === '按专业班次打印条形码') {
        this.getmajor()
      } else if (this.radio4 === '按学员打印条形码') {
        this.getStudentList()
      } else if(this.radio4 === '按考试课程打印条形码'){
        this.getcourse()
      }
    },
    getmajor() {
      let obj = {
        grade: this.grade,
        major: this.major,
        level_: this.pycc,
        current: this.pageNo1,
        size: this.pageSize1
      }
      /* this.tableData3 = [
        [],
        [],
        [],
        [],
      ] */
      return new Promise(() => {
        getmajor(obj).then(res => {
          this.tableData = res.data.data.records
          this.total1 = res.data.data.total
          /* for (let i = 0; i < data.length;) {
            for (let j = 0; j < this.tableData3.length; j++) {
              this.tableData3[j].push(data[i])
              i++
            }
          } */
        })
      })
      // this.tableData3[4] = this.tableData3[4].filter(function (s) {
      //   return s && s.trim(); // 注：IE9(不包含IE9)以下的版本没有trim()方法
      // });
    },
    getcourse() {
      let obj = {
        term:this.term,
        grade: this.grade,
        xb:this.xb,
        classroom: this.classroom,
        level_: this.pycc,
        major:this.major,
        type:this.type,
        majorbc:this.courseName,
        current: this.pageNo,
        size: this.pageSize,
        pc:this.pc
      }
      return new Promise(() => {
        getcourse(obj).then(res => {
          this.tableData3 = res.data.data.records
          this.total = res.data.data.total
        })
      })
    },
    getStudentList() {
      this.tableData1 = []
      this.tableData2 = []
      let obj = {
        studentName: this.studentName,
        studentCode: this.studentNum
      }
      return new Promise(() => {
        studentList(obj).then(res => {
          this.tableData1 = res.data.data
        })
      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    handleSelection(val) {
      this.multipleSelection6 = val
    },
    handleSelectionChange0(val) {
      this.multipleSelection0 = val
    },
    handleSelectionChange1(val) {
      this.multipleSelection1 = val
    },
    handleSelectionChange2(val) {
      this.multipleSelection2 = val
    },
    handleSelectionChange3(val) {
      this.multipleSelection3 = val
    },
    sureTran() {
      let temp = this.multipleSelection.map((item, index) => {
        return item.id;
      });
      this.tableData1 = this.tableData1.filter((e) => !temp.includes(e.id));
      this.tableData2 = [...this.tableData2, ...this.multipleSelection];
    },
    deleTran(multipleSelection) {
      let temp = multipleSelection.id
      this.tableData2 = this.tableData2.filter((e) => !temp.includes(e.id));
      this.tableData1.push(multipleSelection)
    },
    printBarcode() {
      this.printList = []
      if(this.radio4==='按专业班次打印条形码'){
        let arr = []
        this.multipleSelection = []
        if (this.multipleSelection0.length) {
          this.multipleSelectioncl(this.multipleSelection0)
        }
        if (this.multipleSelection1.length) {
          this.multipleSelectioncl(this.multipleSelection1)
        }
        if (this.multipleSelection2.length) {
          this.multipleSelectioncl(this.multipleSelection2)
        }
        if (this.multipleSelection3.length) {
          this.multipleSelectioncl(this.multipleSelection3)
        }
        if (this.multipleSelection.length) {
          for (const Key in this.multipleSelection) {
            arr.push(this.multipleSelection[Key].id)
          }
          return new Promise(() => {
            selectByTeam(arr).then(res => {
              this.printList = res.data.data
              this.$nextTick(function(){
                this.handlePrint()
              })
            })
          })
        } else {
          this.$message({
            message: '请选择要打印的专业班次数据！',
            type: 'warning'
          })
        }
      } else if(this.radio4==='按学员打印条形码'){
        if (this.tableData2.length === 0) {
          this.$message({
            message: '请选择要打印的学员数据！',
            type: 'warning'
          })
        } else {
          if (this.address !== undefined) {
            this.tableData2.forEach(item => {
              for (let index = 0; index < this.address; index++) {
                this.printList.push(item)
              }
            })
          } else {
            this.printList = this.tableData2
          }
          this.$nextTick(function(){
            this.handlePrint()
          })
        }
      }
    },
    handlePrint: function () {
      printJS({
        printable: 'printDiv',
        type: 'html',
        targetStyles: ['*'],
        header: null,
        style: '@page { margin: 1mm; }'
      })
    },
    multipleSelectioncl(val) {
      let temp = this.multipleSelection.map((item, index) => {
        return item.id;
      });
      val = val.filter((e) => !temp.includes(e.id)
      );
      this.multipleSelection = [...val, ...this.multipleSelection];
    },
    printBar(){
      if (this.multipleSelection6.length === 0) {
        this.$message({
          message: '请选择要打印的课程数据！',
          type: 'warning'
        })
      } else {
        let array = []
        this.multipleSelection6.forEach(item => {
          array.push(item.planid)
        })
        queryCourseList(array).then(res => {
          this.printList = res.data.data
          this.$nextTick(function(){
            this.handlePrint()
          })
        })
      }
    }
  },
};
</script>
<style lang="less" scoped>
/deep/.basic-button a{
  outline: none;
}
.search-container {
  justify-content: flex-start !important;
}

.search-button {
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 27px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;

  > span {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  > img {
    width: 19px;
    height: 19px;
    margin-right: 4px;
  }
}

.table-container {
  margin-top: 15px;

  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/special.less";

.table-container5 {
  display: flex;

  .table-data:first-child {
    border-right: none !important;
    border-radius: 9px 0px 0px 9px;
  }

  .table-data:last-child {
    border-radius: 0px 9px 9px 0px;
    border-left: 1px solid #c7d7eb !important;
  }

  .table-data:not(:first-child):not(:last-child) {
    border-right: none !important;
    border-left: 0.8px solid #c7d7eb !important;
    border-radius: 0px !important;
  }

  .table-data {
    min-height: 500px;
  }
}

.table-container ::v-deep .el-table--border .el-table__cell:first-child .cell {
  padding-left: 10px !important;
}

.filter-button1::v-deep .el-radio-button .el-radio-button__inner {
  border-radius: 3px !important;
  border: 1px solid rgb(245, 134, 106);
  color: rgb(245, 134, 106);
  background-color: rgb(254, 237, 226);
}

.filter-button1::v-deep
.el-radio-button__orig-radio:checked
+ .el-radio-button__inner {
  border: 1px solid rgb(245, 134, 106);
  color: white;
  background-color: rgb(245, 134, 106);
  box-shadow: none;
}

.filter-button {
  display: flex;
  margin: 0;
}

.wrapper-container {
  width: 100%;
  margin: 0 auto;
}

// .table-container2 {
//   .table-data {
//     min-height: 500px;
//   }

//   display: flex;
//   justify-content: space-between;
//   align-items: center;
// }

.table-container {
  margin-top: 15px;

  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

.save-button {
  width: 87px;
  height: 36px;
  line-height: 36px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 6px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #f3b815;
  text-align: center;
  margin: 82px auto;
}

.zuoyou {
  width: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
@fontFamily:"Microsoft YaHei";
.xpaas-table-class {
  border: 1px solid #004ca7;
  border-radius: 9px;
  > ::v-deep div.el-table__header-wrapper {
    > table.el-table__header {
      > thead {
        > tr.xpaas-header-row-class {
          padding: 0;
          height: 76px;
          background-color: #edf2f9;
          font-size: 16px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          > th.xpaas-header-cell-class {
            font-weight: bold;
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;
            > div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }
  > ::v-deep div.el-table__body-wrapper {
    > table.el-table__body {
      > tbody {
        > tr.xpaas-row-class {
          > td.xpaas-header-cell-class {
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;
            > div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
          > td.xpaas-cell-class {
            height: 76px;

            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            > div.cell {
              font-weight: normal;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }
}
</style>
